﻿#include "CmdSavePolarCoordinateGraphMainSettingData.h"
#include <QFile>
#include <QDebug>
#include "BaseModule/IBaseSignal.h"
#include "PostCommandPy.h"

namespace PostCommand
{
    CmdSavePolarCoordinateGraphMainSettingData::CmdSavePolarCoordinateGraphMainSettingData()
        : CommandBase()
    {
        this->initCmdName();
    }
    CmdSavePolarCoordinateGraphMainSettingData::~CmdSavePolarCoordinateGraphMainSettingData()
    {
    }

    bool CmdSavePolarCoordinateGraphMainSettingData::execute()
    {
        // bool _success = false;
        emit IBaseSignalInstance->signal_savePolarCoordinateGraphMainSettingData(
            m_mainWindowId,
            m_index,
            m_angDisAxisColor,
            m_angDisAxisThickness,
            m_angDisValuePrecision,
            m_angDisAxisDigitColor,
            m_angDisAxisDigitSize,
            m_angRangIsAutoStepSize,
            m_angRangCustomStepSize,
            m_radDisAxisColor,
            m_radDisAxisThickness,
            m_radDisValuePrecision,
            m_radDisAxisDigitColor,
            m_radDisAxisDigitSize,
            m_radRangIsAutoRange,
            m_radRangMaxValue,
            m_radRangMinValue,
            m_radRangIsAutoStepSize,
            m_radRangCustomStepSize,
            m_gridIsMainGridLineDisplay,
            m_gridMainGridLineColor,
            m_gridMainGridLineStyle,
            m_gridMainGridLineThickness,
            m_titleName,
            m_titleFontColor,
            m_titleFontSize,
            m_legendFontColor,
            m_legendFontSize,
            m_legendLineColor,
            m_legendLineThickness,
            m_dataProResultDataName,
            m_dataProDataLineColor,
            m_dataProDataLineStyle,
            m_dataProDataLineThickness,
            m_dataProIsDisplaySymbol,
            m_dataProSymbolStyle,
            m_dataProSymbolSize,
            m_dataProSymbolColor);
        return true;
    }

    void CmdSavePolarCoordinateGraphMainSettingData::undo()
    {
    }

    void CmdSavePolarCoordinateGraphMainSettingData::redo()
    {
        // execute();
    }

    void CmdSavePolarCoordinateGraphMainSettingData::setPolarCoordinateGraphMainSettingData(int mainWindowId, int index, QString(angDisAxisColor), int angDisAxisThickness, double angDisValuePrecision, QString(angDisAxisDigitColor), int angDisAxisDigitSize,
                                                                                            bool angRangIsAutoStepSize, double angRangCustomStepSize,
                                                                                            QString(radDisAxisColor), int radDisAxisThickness, double radDisValuePrecision, QString(radDisAxisDigitColor), int radDisAxisDigitSize,
                                                                                            bool radRangIsAutoRange, double radRangMaxValue, double radRangMinValue, bool radRangIsAutoStepSize, double radRangCustomStepSize,
                                                                                            bool gridIsMainGridLineDisplay, QString(gridMainGridLineColor), int gridMainGridLineStyle, double gridMainGridLineThickness,
                                                                                            QString(titleName), QString(titleFontColor), int titleFontSize,
                                                                                            QString(legendFontColor), int legendFontSize, QString(legendLineColor), int legendLineThickness,
                                                                                            QString(dataProResultDataName), QString(dataProDataLineColor), int dataProDataLineStyle, double dataProDataLineThickness, bool dataProIsDisplaySymbol, int dataProSymbolStyle, double dataProSymbolSize, QString(dataProSymbolColor))
    {
        m_mainWindowId = mainWindowId;
        m_index = index;
        m_angDisAxisColor = angDisAxisColor;
        m_angDisAxisThickness = angDisAxisThickness;
        m_angDisValuePrecision = angDisValuePrecision;
        m_angDisAxisDigitColor = angDisAxisDigitColor;
        m_angDisAxisDigitSize = angDisAxisDigitSize;
        m_angRangIsAutoStepSize = angRangIsAutoStepSize;
        m_angRangCustomStepSize = angRangCustomStepSize;
        m_radDisAxisColor = radDisAxisColor;
        m_radDisAxisThickness = radDisAxisThickness;
        m_radDisValuePrecision = radDisValuePrecision;
        m_radDisAxisDigitColor = radDisAxisDigitColor;
        m_radDisAxisDigitSize = radDisAxisDigitSize;
        m_radRangIsAutoRange = radRangIsAutoRange;
        m_radRangMaxValue = radRangMaxValue;
        m_radRangMinValue = radRangMinValue;
        m_radRangIsAutoStepSize = radRangIsAutoStepSize;
        m_radRangCustomStepSize = radRangCustomStepSize;
        m_gridIsMainGridLineDisplay = gridIsMainGridLineDisplay;
        m_gridMainGridLineColor = gridMainGridLineColor;
        m_gridMainGridLineStyle = gridMainGridLineStyle;
        m_gridMainGridLineThickness = gridMainGridLineThickness;
        m_titleName = titleName;
        m_titleFontColor = titleFontColor;
        m_titleFontSize = titleFontSize;
        m_legendFontColor = legendFontColor;
        m_legendFontSize = legendFontSize;
        m_legendLineColor = legendLineColor;
        m_legendLineThickness = legendLineThickness;
        m_dataProResultDataName = dataProResultDataName;
        m_dataProDataLineColor = dataProDataLineColor;
        m_dataProDataLineStyle = dataProDataLineStyle;
        m_dataProDataLineThickness = dataProDataLineThickness;
        m_dataProIsDisplaySymbol = dataProIsDisplaySymbol;
        m_dataProSymbolStyle = dataProSymbolStyle;
        m_dataProSymbolSize = dataProSymbolSize;
        m_dataProSymbolColor = dataProSymbolColor;
    }

} // namespace PostCommand
